package com.lc1993929.petserver.controller;

import com.lc1993929.petserver.biz.StoreHandle;
import com.lc1993929.petserver.entity.Result;
import com.lc1993929.petserver.entity.Store;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/pet/store")
public class StoreController {
    @Autowired
    private StoreHandle storeHandle;

    @GetMapping("/list")
    public Result<List<Store>> list() {
        List<Store> stores = storeHandle.list();
        return Result.ok(stores);
    }
}
